In a storage device, data is generally stored by being encoded using an error correcting code in order to protect the storing data. As an example of the encoding using the error correcting code, there is known a product code in which a code word is generated in two dimensions.